package com.example.game_level;

import org.andengine.entity.sprite.Sprite;
import org.andengine.entity.text.Text;
import org.andengine.opengl.font.Font;
import org.andengine.opengl.texture.region.TextureRegion;



public class Spritebutton extends Sprite {
	
	public Spritebutton(TextureRegion pTextureRegion, Font pFont, String pText, float pRed, float pGreen, float pBlue, float pAlpha) {
        super(0, 0, pTextureRegion, StartActivity.getSharedInstance().getVertexBufferObjectManager());
        StartActivity activity;
        activity = StartActivity.getSharedInstance();
        if(activity.level==1&& pTextureRegion==activity.mButtonRegion2){
        	pRed=0.4f;
        	pGreen=0.4f;
        	pBlue=0.4f;
        }
        Text buttonText = new Text(0, 0, activity.hFont, pText,  StartActivity.getSharedInstance().getVertexBufferObjectManager());
        buttonText.setPosition((this.getX() + this.getWidth() - buttonText.getWidth()) / 2, (this.getY() + this.getHeight() - buttonText.getHeight()) / 2);
        buttonText.setColor(pRed, pGreen, pBlue);
        this.setAlpha(pAlpha);
        this.attachChild(buttonText);
}

	


}
